<?php 
$langlist = $this->Session->read("langlist"); 
pr($links);
?>
<div class="row-fluid ">
    <h2 class="text-center" style="">Link registrati:</h2>
        <div class="table-responsive">
        <table class="table-striped table-hover table-condensed text-center" style="width: 95%;background: #fff;">
            <thead >
                <tr style="background-color:#414141;color:#fff;">
                    <th></th>
                    <th class="text-center">Bookmaker</th>
                    <th class="text-center">Lingua</th>
                    <th class="text-center">Link</th>
                    <th></th>
                    <th class="text-center" colspan="2">Azioni</th>
                </tr>
            </thead>
            <tfoot>
                <tr class="text-right">
                    <td colspan="13"><a href="<?php echo $this->webroot?>Link/add"><i class="fa-plus"></i> Aggiungi un Link</a></td>
                </tr>
            </tfoot>
            <tbody>
               <?php if(count($links)==0){ ?>
                 <tr><td colspan="13">Non hai caricato nessun link.</td></tr>  
                   
               <?php }?>
               <?php foreach($links as $key=>$link){?>
               	<?php pr($link["Link"]);die; ?>
                <tr>
                    <td><?php echo $key+1 ?></td>
                    <td><b><a href="<?php echo $this->webroot ?>Bookmaker/edit/<?php echo $link["Link"]["bookmaker_id"]?>"><?php echo $link["Bookmaker"]["nome"]?></a></b></td>
                    <td><i class="<?php echo "famfamfam-flag-".$langlist[$link["Link"]["lang_id"]]["code"];?>"></i> <?php echo $langlist[$link["Link"]["lang_id"]]["name"]; ?></td>
                    <td><a href="<?php echo $link["Link"]["link"]; ?>" target="_blank" class="link" ><?php echo $link["Link"]["link"]?></a></td>
                    <td> &nbsp;</td>
                    <td><a data-confirm href="<?php echo $this->webroot?>Link/delete/<?php echo $link["Link"]["id"]?>"><i class="fa-trash-o"></i> Elimina </a></td>
                    <td><a href="<?php echo $this->webroot?>Link/edit/<?php echo $link["Link"]["id"]?>"><i class="fa-pencil"></i> Modifica </a></td>
                </tr>
               <?php }?>
            </tbody>
        </table>
    </div>
</div>
